public class Teacher {
    public void checkGPA(double GPA) throws GPAException {
        if (GPA < 0 || GPA > 4) {
            throw new GPAException("GPA有误，应在0-4之间");
        } else {
            System.out.println("GPA=" + GPA);
        }

    }
}
